<?php

namespace app\common\models;

class FinanceLog extends BaseModel
{
    public function getWeek()
    {
        $week = [
            '星期日','星期一','星期二','星期三','星期四','星期五','星期六',
        ];
        return $week;
    }
    public function insetLog()
    {
        $date = date('Y-m-d', NEW_TIME);
        $date_array = explode('_', $date);
        $create_time = strtotime($date . ' 00:00:00');
        if (!$this->getExists(['create_time'=>$create_time])){
            return false;
        }
        $week = date('w', NEW_TIME);
        $save_data = [
            'year'=>$date_array['0'],
            'month'=>$date_array['1'],
            'day'=>$date_array['2'],
            'week'=>$week,
            'wx_consume'=>0,
            'ali_consume'=>0,
            'recharge_game'=>0,
            'wx_recharge_game'=>0,
            'ali_recharge_game'=>0,
            'recharge_coin'=>0,
            'wx_recharge_coin'=>0,
            'ali_recharge_coin'=>0,
            'recharge_vip'=>0,
            'wx_recharge_vip'=>0,
            'ali_recharge_vip'=>0,
            'wx_refund'=>0,
            'ali_refund'=>0,
            'wx_withdraw'=>0,
            'ali_withdraw'=>0,
            'create_time'=>0,
        ];
    }
}